home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.05 May 91 / Math Parser ƒ / Node Stuff / SetValues < prev   
Encoding:
Text File  |  1990-09-13  |  1.1 KB  |  60 lines  |  [TEXT/PJMM]

  1. unit SetValues;
  2.  
  3. interface
  4.  
  5.     uses
  6.         ParserGlobals;
  7.  
  8.     procedure setvalues (var nodetable: hdlnoderecord; var numnodes, numvariables: integer);
  9.  
  10.  
  11. implementation
  12.  
  13.     procedure setvalues;
  14.  
  15.         var
  16.             i, j, l, m: integer;
  17.  
  18.  
  19.     begin
  20.  
  21.         i := 1;
  22.         while i <= numnodes do
  23.             begin
  24.                 l := numnodes + 1 - i;
  25.                 j := 1;
  26.                 while j <= numvariables do
  27.                     begin
  28.                         m := numvariables + 1 - j;
  29.  
  30.                         if (nodetable^^[l].lop.index = strvar^^[m]) then
  31.                             begin
  32.                                 nodetable^^[l].lop.index := stringof(val^^[m] : 30 : 20);
  33.                                 nodetable^^[l].loptype := strvartokentype^^[m];
  34.                             end;
  35.                         if (nodetable^^[l].rop.index = strvar^^[m]) then
  36.                             begin
  37.                                 nodetable^^[l].rop.index := stringof(val^^[m] : 30 : 20);
  38.                                 nodetable^^[l].roptype := strvartokentype^^[m];
  39.                             end;
  40.                         j := j + 1;
  41.                     end;
  42.                 i := i + 1;
  43.             end;
  44.  
  45.  
  46.         i := 1;
  47.         while i <= numnodes do
  48.             begin
  49.                 l := numnodes + 1 - i;
  50.                 if nodetable^^[l].lop.index = 'pi' then
  51.                     nodetable^^[l].lop.index := stringof(pivalue : 30 : 20);
  52.                 if nodetable^^[l].rop.index = 'pi' then
  53.                     nodetable^^[l].rop.index := stringof(pivalue : 30 : 20);
  54.                 i := i + 1;
  55.             end;
  56.  
  57.     end;
  58.  
  59.  
  60. end.